<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0"/>
    <div th:include="head :: res"></div>
    <title>用户管理</title>
</head>
<body class="container">
<div th:include="head :: header-nav"></div>
<br>
<a class="btn btn-sm btn-primary" th:href="@{/admin/user/form}">添加用户</a>
<br>
<table class="table table-hover table-condensed">
    <thead>
    <tr>
        <th>用户名</th>
        <th>姓名</th>
        <th>角色</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="user : ${list}">
        <td th:text="${user.getUsername()}"></td>
        <td th:text=" ${user.getName()}"></td>
        <td th:text="${user.getRole().getName()}"></td>
        <td>
            <a class="btn btn-sm btn-info" th:href="@{/admin/user/form(id=${user.id})}">编辑</a>
            <a class="btn btn-sm btn-danger" th:href="@{/admin/user/delete(id=${user.id})}">删除</a>
        </td>
    </tr>
    </tbody>
</table>
</body>
</html>